package com.bootdo.testDemo;

/**
 * 懒汉式单例
 * @author Administrator
 *
 */
public class SingletonLazy {
	
	private static volatile SingletonLazy singletonLazy; 
	
	private static class Hold{
		
	}
	
	private SingletonLazy(){}
	
	public static  SingletonLazy getSingleton(){
		
		if(singletonLazy == null){
			synchronized(SingletonLazy.class){
				if(singletonLazy == null){
					singletonLazy = new SingletonLazy();
				} 
			}
		}


		return singletonLazy;
	}

}
